package cn.edu.scau.sec.caixiaoqing.simpleFactoryMethod.factory;

import cn.edu.scau.sec.caixiaoqing.factory.bean.ConsumerElectronics;
import cn.edu.scau.sec.caixiaoqing.factory.bean.Pad;
import cn.edu.scau.sec.caixiaoqing.factory.bean.Phone;
import cn.edu.scau.sec.caixiaoqing.factory.bean.Watch;

public class ConsumerElectronicsFactory {
    public static final int id_Pad = 1;
    public static final int id_Watch = 2;
    public static final int id_Phone = 3;

    public static ConsumerElectronics getConsumerElectronics(int type){
        switch (type){
            case id_Pad:    return new Pad();
            case id_Watch:  return new Watch();
            case id_Phone:  return new Phone();
            default:        return null;
        }
    }
}
